<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
    <ui:composition template="/WEB-INF/facelets/template.xhtml">
        
        <ui:param name="title" value="JadeTalk Register" />
        
        <ui:define name="content">
            <div id="registerForm" class="textCentered">

                <h:form>
                    <fieldset>
                        <legend><h3>REGISTER</h3></legend>
                        <h:panelGrid columns="2" cellpadding="5">
                            Username: <br></br><h:inputText value="#{registerBackingBean.name}" label="Username"/>
                            Password: <br></br><h:inputSecret value="#{registerBackingBean.password}" label="Password"/>
                            Confirm password: <br></br><h:inputSecret value="#{registerBackingBean.confirmedPassword}" label="Confirm password" />
                            E-mail: <br></br><h:inputText value="#{registerBackingBean.email}" label="E-mail address" />

                            <h:commandButton value="Register" action="#{registerControllerBean.register}" id="register" styleClass="loginButton">
                                <f:ajax execute="@form" render="@form" />
                            </h:commandButton>
                            
                            <h:outputText value="#{registerBackingBean.message}" />
                            
                        </h:panelGrid>
                    </fieldset>
                </h:form>
                
            </div>
            
            <div class="clearDiv" />
        </ui:define>
    </ui:composition>
</html>

